Enable heap snapshots for POSIX distributables#182082
Enable heap snapshots for POSIX distributables#182082jloleysens merged 5 commits intoelastic:mainfrom
Conversation
|
Pinging @elastic/kibana-core (Team:Core) |
| NODE_OPTIONS="--no-warnings --max-http-header-size=65536 $KBN_NODE_OPTS $NODE_OPTIONS" NODE_ENV=production exec "${NODE}" "${DIR}/src/cli/dist" "${@}" | ||
| # Enable capturing heap snapshots. See https://nodejs.org/api/cli.html#--heapsnapshot-signalsignal | ||
| # For now only on POSIX platforms, term signals work differently on Windows. | ||
| NODE_OPTIONS_HEAPSNAPSHOT_DEFAULT="--heapsnapshot-signal=SIGUSR2 --diagnostic-dir=./data" |
There was a problem hiding this comment.
On deb and rpm package this isn't going to work. The kibana user will not have write access to anything in /usr/share/kibana. The data directory is at /var/lib/kibana.
There was a problem hiding this comment.
For tar.gz it should be something like this to support starting Kibana from outside the root directory:
| NODE_OPTIONS_HEAPSNAPSHOT_DEFAULT="--heapsnapshot-signal=SIGUSR2 --diagnostic-dir=./data" | |
| NODE_OPTIONS_HEAPSNAPSHOT_DEFAULT="--heapsnapshot-signal=SIGUSR2 --diagnostic-dir=${DIR}/data" |
There was a problem hiding this comment.
NODE_OPTIONS_HEAPSNAPSHOT_DEFAULT="--heapsnapshot-signal=SIGUSR2 --diagnostic-dir=/var/lib/kibana"
and then in bin/kibana:
NODE_OPTIONS_HEAPSNAPSHOT_DEFAULT="${NODE_OPTIONS_HEAPSNAPSHOT_DEFAULT:---heapsnapshot-signal=SIGUSR2 --diagnostic-dir=${DIR}/data}"
Mind if we add the ci:build-all-platforms and ci:build-os-packages labels after to test if we go this route?
jloleysens
left a comment
There was a problem hiding this comment.
Also tested submitting a heap snapshot workflow on serverless
💚 Build Succeeded
The CI Stats report is too large to be displayed here, check out the CI build annotation for this information. History
To update your PR or re-run it, just comment with: cc @jloleysens |
Summary
See #181363
Changed the approach to only enable this by default for POSIX platforms (added defaults to the
bin/kibana.shscript). Can be tested in the same way as the previous PR but only available on Linux/macOS.